<HTML><HEAD><TITLE>get_median(?Var, -Median)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(ic)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>get_median(?Var, -Median)</H1>
Returns the median of the interval of the IC variable Var.
<DL>
<DT><EM>Var</EM></DT>
<DD>A variable or a number
</DD>
<DT><EM>Median</EM></DT>
<DD>The median of the interval (float)
</DD>
</DL>
<H2>Description</H2>
<P>
   Returns the median of the interval of Var (usually so that the interval
   can be split) as a float value.  If Var has not been declared before,
   it will be turned into an unrestricted real variable as a side effect.
   If Var is a ground number, the median is a float equal or near that
   number.

   Generally, the median splits the interval logarithmically so that the
   two subintervals have roughly the same number of representable floats.
   Only in the vicinity of zero, splitting is linear to prevent the sub-
   intervals from getting too small.</P>

<H3>Modes and Determinism</H3><UL>
<LI>get_median(?, -) is det
</UL>
<H2>Examples</H2>
<PRE>[eclipse 2]: X :: 10..1000, get_median(X, M).
X = X{10 .. 1000}
M = 100.0
Yes (0.00s cpu)

[eclipse 3]: X :: -1..1000, get_median(X, M).
X = X{-1 .. 1000}
M = 11.633369384516794
Yes (0.00s cpu)

[eclipse 4]: get_median(3, M).
M = 3.0
Yes (0.00s cpu)
</PRE>
<H2>See Also</H2>
<A HREF="../../lib/ic/get_delta-2.html">get_delta / 2</A>, <A HREF="../../lib/ic/get_bounds-3.html">get_bounds / 3</A>, <A HREF="../../lib/ic/get_float_bounds-3.html">get_float_bounds / 3</A>
</BODY></HTML>
